<template>
	<view class="my-store-info">
		<view class="list">
			<u-list>
				<u-list-item v-for="(item, index) in indexList" :key="index">
					<view class="li" @tap="getValue(item)">222</view>
				</u-list-item>
			</u-list>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	const globalData = app.globalData;
	const apiUrl = globalData.wxApi;
	const wxImg = globalData.wxImg;
	import {
		getStoreData,
		dealNum,
		httpPost,
		bdMapToTxMap,
		txMapToBdMap,
	} from "@/utils/http.js";
	import mpMixin from "../../../uni_modules/uview-ui/libs/mixin/mpMixin";
	const pic1 = require(`@/img/my/my1.png`);
	import popupActivity from "./popupActivity";


	export default {
		data() {
			return {
				wxImg,
				apiUrl,
				dealNum,
				pic1,
				value: "",
				userInfo: {},
				indexList:[]
				
			};
		},
		components: {
			popupActivity,
		},
		onShow() {

		},
		onUnload() {

		},
		onLoad(options) {
             this.getList()
		},
		methods: {
			getList(){
				
			},
			getValue(){
				
			},
			getSubmit() {
				if (!this.storeInfo.name) {
					uni.showToast({
						icon: "none",
						title: "请输入门店名称"
					});
					return;
				} else if (!this.storeInfo.imgLogo) {
					uni.showToast({
						icon: "none",
						title: "请上传门店图片"
					});
					return;
				} else if (!this.storeInfo.serviceName) {
					uni.showToast({
						icon: "none",
						title: "请输入负责人姓名"
					});
					return;
				} else if (!this.storeInfo.phone) {
					uni.showToast({
						icon: "none",
						title: "请输入客服电话"
					});
					return;
				} else if (!this.storeInfo.email) {
					uni.showToast({
						icon: "none",
						title: "请输入邮箱"
					});
					return;
				} else if (!this.storeInfo.areaName) {
					uni.showToast({
						icon: "none",
						title: "请选择所在地区"
					});
					return;
				} else if (!this.storeInfo.areaName4) {
					uni.showToast({
						icon: "none",
						title: "请输入详细地址"
					});
					return;
				} else if (!this.storeInfo.areaName) {
					uni.showToast({
						icon: "none",
						title: "请选择点位地址"
					});
					return;
				}

				if (this.title === "新增店铺") {
					const params = {
						...this.storeInfo,
						address: this.storeInfo.provinceName +
							" " +
							this.storeInfo.cityName +
							" " +
							this.storeInfo.areaName +
							" " +
							this.storeInfo.areaName3 +
							" " +
							this.storeInfo.areaName4,
						userId: getStoreData("userInfo").id,
					};
					httpPost("/api/sellerstoreotherapply/createStore", params)
						.then((res) => {
							if (res.code == 0) {
								wx.navigateBack({
									delta: 1, // 返回上一级页面。
								});
							}
						})
						.catch((e) => {});
				} else {
					const params = {
						...this.storeInfo,
						address: this.storeInfo.provinceName +
							" " +
							this.storeInfo.cityName +
							" " +
							this.storeInfo.areaName +
							" " +
							this.storeInfo.areaName3 +
							" " +
							this.storeInfo.areaName4,
					};

					httpPost("/api/sellerstoreotherapply/updateStore", params)
						.then((res) => {
							if (res.code == 0) {
								uni.navigateBack({
									delta: 1, // 返回上一级页面。
								});
							}
						})
						.catch((e) => {});
				}
			},


		},
	};
</script>

<style lang="scss">
	.my-store-info {
		background-color: #f4f5f7;
		padding-top: 20rpx;
	}

	.store-box {
		width: 650rpx;
		margin-left: 30rpx;
		background-color: #fff;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		padding: 20rpx;

		.title {
			font-size: 28rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
	}

	/deep/ .u-cell__title-text {
		font-size: 28rpx;
	}
</style>